package pjwstk.jps.ast.auxname;

import pjwstk.jps.ast.Expression;
import pjwstk.jps.ast.IExpression;
import pjwstk.jps.visitor.ASTVisitor;
import pjwstk.jps.ast.terminal.NameTerminal;

/**
 * @author s9111_s10304
 *
 */
public class GroupAsExpression extends Expression implements IGroupAsExpression
{
	private String name;
	private IExpression innerExpression;
	
	public GroupAsExpression(IExpression aExpression, NameTerminal aName) {
        name = aName.getName();
        innerExpression = aExpression;
    }
	
	@Override
	public String getAuxiliaryName() {
		return name;
	}

	@Override
	public IExpression getInnerExpression() {
		return innerExpression;
	}

	@Override
	public void accept(ASTVisitor visitor) {
		visitor.visitGroupAsExpression(this);
	}
}